import random
import numpy as np


def game_show(array):
    for x in range(4):
        for y in range(4):
            print(array[x][y], end=' ')
        print()


def game_start():
    game_in_list = np.zeros((4, 4), dtype=int)
    game_in_list[[random.randint(0, 3)], [random.randint(0, 3)]] = 2
    game_in_list[[random.randint(0, 3)], [random.randint(0, 3)]] = 2
    game_show(game_in_list)
    return game_in_list

def reset_array(array, move):
    if move == 'w' or 's':
        return array
    elif move == 'a' or 'd':
        return array.T
def game_move():
    print('请输入移动方向：w上，s下，a左，d右')
    move = input()
    if move == 'w':
        reset_array(game_list, move)

    elif move == 's':
    elif move == 'a':
    elif move == 'd':
def game_over():


if __name__ == '__main__':
    game_list = game_start()
